<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--标准mui.css-->
		<link rel="stylesheet" href="../../css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" href="../../css/comman.css">
	</head>

	<body>
		<header class="mui-bar mui-bar-nav pan_head_bg">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left pan_head_font"></a>

			<h1 class="mui-title"><span id="iControlList_title" class="pan_head_font">文章查看</span></h1>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded">
				<h4 id="title">文章标题</h4>
				<div class="news-small-detail">
					发布日期：<span id="publishdate">20140114</span>
					&nbsp;&nbsp;浏览量：<span id="seenum">114</span></div>
				<div class="news-content-detail">
				</div>
				
				<div id="content">
				</div>
				
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../js/jquery.js" ></script>
	<script src="../../js/mui.min.js"></script>
	<script type="text/javascript" src="../../js/pan_config.js" ></script>
	<script type="text/javascript">
		mui.init({
			swipeBack:true //启用右滑关闭功能
		});
		mui.plusReady(function() {
			var currentview=plus.webview.currentWebview();
			loadnewsdata(currentview.ID)
		});
		
		function loadnewsdata(ID){
        	panUtil.ajaxLoding.start();
	        mui.ajax(baseServerAdrr+'/news/getSingleWorkNews',{
          	   dataType:'json',//服务器返回json格式数据
          	   data: {ID:ID},
	           type:'post',//HTTP请求类型
	           timeout:30000,//超时时间设置为10秒；
	           success:function(data){
		           panUtil.ajaxLoding.stop();
		           var innerhtml="";
		           if(data.code=='success'){
                        $("#title").html(data.TITLE);
			            $("#publishdate").html(data.DATEPUBLISHED);
			            $("#seenum").html(data.PRINTNUM);
			            console.log();
			            if(data.CHECKER!=null&&data.CHECKER!="null"&&data.CHECKER!=""){
			            	
				           $(".news-content-detail").html("<img src=\""+baseServerAdrr.replace("espsl5","")+
				                data.CHECKER+"\" data-preview-src=\"\" data-preview-group=\"1\" />");
			            }
			            var str=data.CONTENT;
			            //console.log(str);
			            str = str.replace(/<div[^>]*>/gi,'!!!333'); //把<div> 换成!!!333
			            str = str.replace(/<\/div[^>]*>/gi,'!!!222'); //把</div> 换成!!!222
			            str = str.replace(/<p[^>]*>/gi,'!!!333'); //把<p> 换成!!!333
			            str = str.replace(/<\/p[^>]*>/gi,'!!!222'); //把</p> 换成!!!222
                        str = str.replace(/<\/?[^>]*>/gi,''); //去除HTML tag
                        str = str.replace(/[&nbsp;]*/gi,''); //去掉空格
                        str = str.replace(/!!!333/g,'<p style="font-size:16px;color:#484848">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;').replace(/!!!222/g,'</p>');
                        str = str.replace(/[ | ]*\n/g,'\n'); //去除行尾空白
                        str = str.replace(/\n[\s| | ]*\r/g,'\n'); //去除多余空行
                        str = str.replace(/\n[\s| | ]*\r/g,'\n'); //去除多余空行
                        str = str.replace(/<p style="font-size:16px;color:#484848">[&nbsp;]*<\/p>/gi,''); //空白行
                        str = str.replace(/ldquo/gi,'&ldquo;').replace(/rdquo/gi,'&rdquo;'); //空白行
                        //str=str.replace(/<([a-zA-Z]+)\s*[^><]*>/g,"<$1>");//去掉标签属性
                        //console.log(str)
			           $("#content").html(str);
		           }else{
		   	           mui.toast(data.message);
		           }
	            },
	           error:function(xhr,type,errorThrown){
		            //异常处理；
		           panUtil.ajaxLoding.stop();
		           mui.toast('服务器异常登录失败! gzdtdetail.html');
	            }
		    });
        }
	</script>
</html>